package so.sao.code.service.infrastructure.enums.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.PrintFileFieldConfigGroup;

@Converter(autoApply = true)
public class PrintFileFieldConfigGroupConvert implements AttributeConverter<PrintFileFieldConfigGroup, String> {

	@Override
	public String convertToDatabaseColumn(PrintFileFieldConfigGroup attribute) {
		return attribute.getValue();
	}

	@Override
	public PrintFileFieldConfigGroup convertToEntityAttribute(String dbData) {
		return PrintFileFieldConfigGroup.fromValue(dbData);
	}

}
